Implement filter metrics list command#2
Conversation
| :param str metric_names: The list of metric names | ||
| ''' | ||
| odata_filter = _metrics_odata_filter_builder(time_grain, start_time, end_time, metric_names) | ||
| print(odata_filter) |
There was a problem hiding this comment.
indeed. i missed it :)
| '''Lists the metric values for a resource. | ||
| :param str resource_uri: The identifier of the resource | ||
| :param str time_grain: The time grain. Granularity of the metric data returned in ISO 8601 | ||
| duration format, eg "duration'PT1M'" |
There was a problem hiding this comment.
Is there a way for us to simplify this? Why would I have to type "duration'PT1M'"?
There was a problem hiding this comment.
I think if we can converts HH:mm:ss into ISO 8601. Let me look and see whether we have done it somewhere or not or how can we do that.
| timezone: 1970-01-01T00:00:00Z, 1970-01-01T00:00:00-0500 | ||
| :param str end_time: The end time of the query. In ISO format with explicit indication of | ||
| timezone: 1970-01-01T00:00:00Z, 1970-01-01T00:00:00-0500 | ||
| :param str metric_names: The list of metric names |
There was a problem hiding this comment.
Should clarify "The space separated list of metric names." Otherwise you will get people using comma separated values.
| filters.append('({})'.format(metrics_filter)) | ||
|
|
||
| if time_grain: | ||
| filters.append("timeGrain eq duration'{}'".format(time_grain)) |
There was a problem hiding this comment.
So this would read "timeGrain eq duration'duration'PT1M''"?
There was a problem hiding this comment.
Opps the help message is wrong. Help message should not be 'duration'PT1M'' only 'PT1M'
| @@ -48,3 +48,6 @@ | |||
|
|
|||
| with ParametersContext(command='monitor metric-definitions list') as c: | |||
| c.argument('metric_names', None, nargs='+') | |||
There was a problem hiding this comment.
haha..silly i can just avoid that.
* initial update * update * add the CLI for 2017-04-18 swagger file * cognitive service cli - inital version' * rollback debug code change * style refactoring update * update * change the term text to yellow highlighted * code comment fix - update #1 * fix code comments - update #2 * 1.fix flake 8 styling error 2. add the depedencies in setup, * fix an change in our service legal terms. * fix a help.py styling issue * update the setup.py * update description of setup.py
Before:
After:
Example 1:
Example 2:
XPlat CLI Reference: https://github.com/Azure/azure-xplat-cli/blob/dev/lib/commands/arm/insights/insights.metrics._js#L44
@troydai @tjprescott @derekbekoe Please review the PR when you get a chance. Thanks!